package com.itheima.mapper;

import com.itheima.entity.FlowInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface FlowMapper {

    @Select("select * from tb_flow order by create_time desc")
    List<FlowInfo> selectFlowList();

    @Update("update tb_flow set state = 0 where id=#{id}")
    int updateFlowDeployState(Long id);

    @Select("select * from tb_flow where id=#{id}")
    FlowInfo selectOneFlow(Long id);
    @Insert("insert into tb_flow values(#{id},#{flowname},#{flowkey},#{filepath},#{state},#{createtime})")
    int saveFlow(FlowInfo flowInfo);
}
